﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using 自制数学工具;

namespace Test
{
    public class 数学工具测试类
    {
        public static void Main(string[] args)
        {
            Point A = new Point(0,0,10);
            Point B = new Point(8.66,5,20);
            Point C = new Point(10,0,10);
            Point D = new Point(40,30,10);
            //圆心坐标O
            Point O = new Point(0,0,0);
            //直线延长距离
            double L = 10;
            //坐标点平移距离
            double offset = 10;
            //直线逆时针旋转角度的度数值
            double Rotaion_A = 90;
            //圆的半径
            double R = 10;
            //testOne(A, B, L);
            //testTwo(A, offset);
            //testThree(A, B, Rotaion_A, R);
            //testFour(A, B, C);
            //testFive(A, B, C, D);
            testSix(A, 5, C);
            //testSeven(O,R,A,B);
            testEight(A, 10, B);
        }

        private static void testOne(Point A,Point B,double L)
        {
            Point one = Maths.GetExtendPoint(A,B,L);
            Console.WriteLine($"新坐标点坐标为：({one.X},{one.Y})");
        }

        private static void testTwo(Point A, double offset)
        {
            Point one = Maths.GetPanningPoint(A,offset);
            Console.WriteLine($"新坐标点坐标为：({one.X},{one.Y})");
        }

        public static void testThree(Point A, Point B, double Rotaion_A, double R)
        {
            Point one = Maths.GetRotationPoint(A, B, Rotaion_A, R);
            Console.WriteLine($"新坐标点坐标为：({one.X},{one.Y})");
        }

        public static void testFour(Point A, Point B, Point C)
        {
            Vector vector = Maths.GetNormalVector(A,B,C);
            Console.WriteLine($"单位法向量坐标为：({vector.X},{vector.Y},{vector.Z})");
        }

        private static void testFive(Point A, Point B, Point C, Point D)
        {
            Point one = Maths.GetMeetingPoint(A, B, C, D);
            Console.WriteLine($"交点坐标为：({one.X},{one.Y})");
        }
        private static void testSix(Point O, double R, Point A)
        {
            Point[] points = Maths.GetTangentPoint(O, R, A);
            Console.WriteLine($"交点坐标为({points[0].X},{points[0].Y}),({points[1].X},{points[1].Y})");
        }
        private static void testSeven(Point O, double R, Point A, Point B)
        {
            Point[] points = Maths.GetLineMeetingPoint(O, R, A, B);
            Console.WriteLine($"交点坐标为({points[0].X},{points[0].Y}),({points[1].X},{points[1].Y})");
        }
        private static void testEight(Point O, double R, Point A)
        {
            double a = Maths.GetCircleDirection(O, R, A);
            Console.WriteLine($"该点的切线方向角为：{a}度");
        }
    }
}
